package com.wit.WEB.service.impl;

import com.github.pagehelper.PageHelper;
import com.wit.WEB.entity.TestStand;
import com.wit.WEB.mapper.TestStandMapper;
import com.wit.WEB.service.TestStandService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @program: java-web-group
 * @description: 检测站
 * @author: KingTeng
 * @create: 2022-02-28 14:16
 **/
@Service
public class TestStandServiceimpl implements TestStandService {
    private TestStandMapper testStandMapper;

    @Autowired
    private void setTestStandMapper(TestStandMapper testStandMapper){this.testStandMapper=testStandMapper;}
    @Override
    public List<TestStand> list(int page,int size) {
        PageHelper.startPage(page,size);
        List<TestStand> stands = testStandMapper.FindAll();
        return  stands;
    }

    @Override
    public List<TestStand> selectByCity(String city) {
        List<TestStand> ids=testStandMapper.selectByCity(city);
        return ids;
    }

    @Override
    public List<TestStand> findall() {
        return testStandMapper.FindAll();
    }

    @Override
    public TestStand findbyprimary(Integer tid) {
        TestStand testStand=testStandMapper.selectByPrimaryKey(tid);
        return testStand;
    }

    @Override
    public TestStand findbyUid(Integer tid) {
        TestStand testStand=testStandMapper.findbyUid(tid);
        return testStand;
    }

    @Override
    public TestStand selectByprimary(Integer tid) {
        return testStandMapper.selectByPrimaryKey(tid);
    }

    @Override
    public void inser(TestStand testStand) {
        testStandMapper.insertSelective(testStand);
    }

    @Override
    public void deleteByID(String id) {
        testStandMapper.deleteByPrimaryKey(Integer.parseInt(id));
    }
}
